# -*- coding: UTF-8 -*-
# Common settings

#import warnings; warnings.simplefilter("ignore")
import os
from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'es'

SITE_ID = 1

# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True

# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale
USE_L10N = True

MIDDLEWARE_CLASSES = (
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    #'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
    'responsive.middleware.DeviceInfoMiddleware',
)

ROOT_URLCONF = 'brw.urls'

INSTALLED_APPS = (
     'django.contrib.auth',
     'django.contrib.contenttypes',
     'django.contrib.sessions',
     'django.contrib.messages',
     'django.contrib.staticfiles',
     'brw',
     'avanzaweb',
     'mdm',
     'globaltags',
     'grappelli',
     'django.contrib.admin',
)

#~ avanzapromociones.es
RECAPTCHA_PUBLIC_KEY = '6LcYlbwSAAAAANH7GAc9qjUAz2q37xbOdAU32Lq5'
RECAPTCHA_PRIVATE_KEY = '6LcYlbwSAAAAAJE232SYWWDBzerJeBh3xWPw_UHF'

#~ Avanza
MAPS_API_KEY='ABQIAAAA8gTd8rieodq7_5ENajMHGxRnLUZylWaVHki_mVKjkSela7JenRTTJUGSwUk_uRusRPqoSGzuyTMHVQ'

TEMPLATE_CONTEXT_PROCESSORS = TEMPLATE_CONTEXT_PROCESSORS + ('django.core.context_processors.request','responsive.context_processors.device_info',)

# A sample logging configuration. The only tangible logging
# performed by this configuration is to send an email to
# the site admins on every HTTP 500 error.
# See http://docs.djangoproject.com/en/dev/topics/logging for
# more details on how to customize your logging configuration.
LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'handlers': {
        'mail_admins': {
            'level': 'ERROR',
            'class': 'django.utils.log.AdminEmailHandler'
        }
    },
    'loggers': {
        'django.request': {
            'handlers': ['mail_admins'],
            'level': 'ERROR',
            'propagate': True,
        },
    }
}

#Como en http://blog.zacharyvoase.com/2010/02/03/django-project-conventions/
PROJECT_ROOT = os.path.dirname(os.path.dirname(__file__)) #path(__file__).abspath().dirname().dirname()
PUBLIC_ROOT = PROJECT_ROOT + '/public/'
MEDIA_ROOT = PUBLIC_ROOT + '/site_media/'
STATIC_URL = '/static/'
SECRET_KEY = '$u^@l7l(blr9&%*v)k@8-kmowlv)dcyxf#5aw9j_a(&^(+z6j8'